package com.demo.blog.common.advice;


import com.demo.blog.pojo.response.Result;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RestControllerAdvice;

//统一异常处理
@Slf4j
@RestControllerAdvice
public class ExceptionAdvice {

    public Result handler(Exception e) {
        log.info("发生异常，e: {}",e);
        return Result.fail(e.getMessage());
    }
}
